<template>
  <div>
    姓名：<input v-model="userName" /> {{ userName }} <br />
    薪⽔：<input type="number" v-model="salary" /> <button @click="addSalary">薪⽔加1000</button> {{ salary }}
  </div>
</template>
<script lang="ts">
export default {
  setup() {
    //现在声明的变量还不具备双向绑定
    let userName = "王⼀"
    let salary = 15000
    function addSalary() {
      salary += 1000
      console.log("salary = " + salary)
    }
    //模板要⽤哪些，就返回哪些
    return { userName, salary, addSalary }
  }
}
</script>
<style scoped></style>
